{layout name="layout" /}

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header layuiadmin-card-header-auto"></div>
        <div class="layui-card-body">
            <table id="zbc-product-manage" lay-filter="zbc-product-manage"></table>
        </div>
    </div>
</div>
<script type="text/html" id="toolbarDemo">
    <div class="layui-btn-container">
        <button class="layui-btn layuiadmin-btn-useradmin" data-type="batchdel">删除</button>
        <button class="layui-btn layuiadmin-btn-useradmin" data-type="add">添加</button>
    </div>
</script>
<script type="text/html" id="table-content-custom">
    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
</script>
<script>
    layui
        .config({
            base: "/static/layuiadmin/" //静态资源所在路径
        })
        .extend({
            index: "lib/index", //主入口模块
        })
        .use(["index", "curdtable"], function () {
            var $ = layui.$,
                form = layui.form,
                curdtable = layui.curdtable;
            curdtable.init({
                TABLEID: 'zbc-product-manage',
                FORMSUBMIT: "zbc-product-submit",
                PAGEURL: '/admin/product/page',
                DELETEURL: '/admin/product/delete',
                EDITURL: '/admin/product/edit',
                ADDURL: '/admin/product/add',
                EDITTITLE: '编辑商品',
                ADDTITLE: '添加商品',
                LAYERAREA: ['900px', '620px'],
                cols: [
                    [
                        { type: "checkbox" },
                        { field: "id", width: 80, title: "编号" },
                        { field: "name", title: "商品名称" },
                        { field: "order", title: "排序" },
                        { field: "createTime", title: "创建时间" },
                        {
                            title: "操作",
                            width: 150,
                            align: "center",
                            fixed: "right",
                            toolbar: "#table-content-custom"
                        }
                    ]
                ]
            }).render();
        });
</script>